<?php
include_once './Test.php';
$input = file_get_contents("php://input");
$post=json_decode($input,true);
$productKey = $post['productKey'];
$deviceName = $post['device_sn'];

//启动程序命令
	$post_data['topic'] = "/". $productKey ."/" . $deviceName ."/cmd";
	$post_data['value']      =  $post['package_id'];
	$post_data['cmd']        =  $post['cmd'];
	$post_data['ts']         =  time();
	
	$SmsDemo = new Tests();
	$data = $SmsDemo->pubTest($productKey,$deviceName,$post_data);
	print_r(json_encode($data));

//zJu5dp2h2vU/865933031094853/cmd
/* $request = new Iot\CreateProductRequest();
$request->setProductKey("zJu5dp2h2vU");
$request->setMessageContent("3Jvi8MI1qhEsquX2+MQmuw=="); //hello world Base64 String.
$request->setTopicFullName("/zJu5dp2h2vU/865933031094853/cmd"); //消息发送到的Topic全名.
$response = $client->getAcsResponse($request);
print_r($response); */


//$response = $SmsDemo::pubTests('zJu5dp2h2vU',865933031094853);
//$response = $SmsDemo->pubTests('zJu5dp2h2vU',865933031094853);
